import request from '@/utils/request';

// 查询平台店铺列表
export async function queryShopList(params) {
    const data = { current: 1, size: 100, ...params }
    return request(`/blade-goods/newSystem/ecStore/list/page`, {
        method: 'POST',
        data: data,
    });
}

// 查询奇门店铺列表
export async function queryQimenShopList(params) {
    const data = { current: 1, size: 100, ...params }
    return request(`/blade-goods/jushuitanstore/page`, {
        method: 'POST',
        data: data,
    }).then(res => {
        if (!res?.data?.records) {
            return res
        }

        // 兼容上面的平台列表
        res.data.records = res.data.records.map(item => {
            item.type = item.type || 13
            item.storeId = item.storeId || item.shopId
            item.storeName = item.storeName || item.shopName
            item.typeName = item.typeName || '奇门'

            return item
        })

        return res
    })
}



